@extends('admin.public')

@section('content')
    <div class="col-md-12">
        <form data-validate="parsley" method="post" enctype="multipart/form-data">
            {!! csrf_field() !!}
            <section class="panel panel-default">
                <header class="panel-heading">
                    {{ $frame['title'] }}
                    <a href="{{ route('admin.page.pagelabel') }}" class="btn btn-xs btn-default pull-right">信息模块</a>
                </header>
                <div class="panel-body">
                    <p class="text-muted">请注意不要重复添加相同的模块</p>
                    <div class="form-group pull-in clearfix">
                        <div class="col-sm-6">
                            <label>模块名称</label>
                            <input type="text" class="form-control parsley-validated" data-required="true" name="name"
                                   placeholder="请添加模块名称">
                        </div>
                        <div class="col-sm-6">
                            <label>模块标签</label>
                            <div class="input-group m-b">
                                <span class="input-group-addon">{{ '{' }}{ $pages['</span>
                                <input type="text" class="form-control" placeholder="请填写模块标签" name="label">
                                <span class="input-group-addon">'] }}</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group pull-in clearfix">
                        <div class="col-sm-4">
                            <label>模块图片</label>
                            <div class="clearfix"></div>
                            <input type="file" class="filestyle" data-icon="true" data-classButton="btn btn-default"
                                   name="image" data-classInput="form-control inline v-middle input-s">
                        </div>
                        <div class="col-sm-4">
                            <label>模块优先级</label>
                            <div class="clearfix"></div>
                            <input class="slider slider-horizontal form-control" type="text" value="1" name="xindex"
                                   data-slider-min="1" data-slider-max="100" data-slider-step="1" data-slider-value="1"
                                   data-slider-orientation="horizontal">
                        </div>
                        <div class="col-sm-4">
                            <label>默认信息模版</label>
                            <div class="clearfix"></div>
                            <select style="width:100%" class="chosen-select" name="theme">
                                @foreach( $infoThemes as $theme )
                                    <option value="{{ $theme }}">{{ $theme }}</option>
                                @endforeach
                            </select>
                        </div>
                    </div>
                    <div class="checkbox i-checks">
                        <label>
                            <input type="checkbox" name="status" checked dirname="status"><i></i>勾选此项,即开启此模块
                        </label>
                    </div>
                </div>
                <footer class="panel-footer text-right bg-light lter">
                    <button type="submit" class="btn btn-success btn-s-xs">保存</button>
                </footer>
            </section>
        </form>
    </div>
@endsection

@section('css')
    <link rel="stylesheet" href="/public/theme/js/chosen/chosen.css" type="text/css"/>
    <link rel="stylesheet" href="/public/theme/js/slider/slider.css" type="text/css"/>
@endsection

@section('js')
    <!-- file input -->
    <script src="/public/theme/js/file-input/bootstrap-filestyle.min.js"></script>
    <!-- slider -->
    <script src="/public/theme/js/slider/bootstrap-slider.js"></script>
    <!-- Chosen -->
    <script src="/public/theme/js/chosen/chosen.jquery.min.js"></script>
@endsection